# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-aioresponses
pkgver=0.7.4
pkgrel=2
pkgdesc="A helper to mock/fake web requests in python aiohttp package."
url="https://github.com/pnuckowski/aioresponses"
license=('MIT')
arch=('any')
depends=('python-aiohttp')
makedepends=('python-pbr')
checkdepends=('python-pytest-runner' 'python-ddt' 'python-asynctest')
source=("$pkgname-$pkgver.tar.gz::https://github.com/pnuckowski/aioresponses/archive/$pkgver.tar.gz")
sha512sums=('dcb387f5f04d5bb7c2795c5d6416e0346015eaff2b3809f5fe93eafa864d0fb0c92b8e8e2e3635e4032f76cc9119f772fc86582c4cbd9895caaf023a47075622')

prepare() {
  export PBR_VERSION=$pkgver
}

build() {
  cd aioresponses-$pkgver
  python setup.py build
}

check() {
  cd aioresponses-$pkgver
  python setup.py pytest
}

package() {
  cd aioresponses-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
